<template>
  <div class="app-container">
    <el-card shadow="never"> 

        <el-form :model="formData">
            
            <el-form-item label="时间配置" label-width="90px">
                
                <el-radio-group v-model="formData.id">
                    <el-radio 
                        v-for="(item, index) in configTimes" 
                        :key="index"
                        :label="index">{{item}}天</el-radio>
                </el-radio-group>

            </el-form-item>
            <el-form-item>
                <el-button type="primary" align @click="onSubmit">保存</el-button>
            </el-form-item>
        </el-form>

    </el-card>
  </div>
</template>

<script>
import { listTimesConfig, updateConfig } from '@/api/assignConfig';

export default {
  data() {
    return {
      configTimes: [],
      formData: {
        id: undefined,
      }
    };
  },

  created() {
    listTimesConfig(this);
  },

  methods: {
    onSubmit() {
        updateConfig(this.formData, this)
    }
 }
};
</script>

<style></style>
